#include<iostream>
using namespace std;

const int size = 5050;

class Solution
{
public:
    //1-N from M run K to P 
    int getPathNum(int N,int M,int K,int P) {
        if(K == 0) {
            return M == P ? 1 : 0;
        }
        if(M == 1) {
            return getPathNum(N,M+1,K-1,P);
        }
        if(M == N) {
            return getPathNum(M,M-1,K-1,P);
        }
        return getPathNum(N,M+1,K-1,P) + getPathNum(N,M-1,K-1,P);
    }
    int getPathNum2(int N,int M,int K,int P) {
        int dp[size][size];
        for(int i=0; i<size; i++) {
            for(int j=0; j<size; j++) {
                dp[i][j] = -1;
            }
        }
        int ret = process(N,M,K,P,dp);
        return ret;
    }
    int process(int N,int M,int K,int P,int dp[][size]) {
        if(dp[M][K] != -1) {
            return dp[M][K];
        }
        if(K == 0) {
            dp[M][K] = M == P ? 1 : 0;
        } else if(M == 1) {
            dp[M][K] = process(N,M+1,K-1,P,dp);
        }else if(M == N) {
            dp[M][K] = process(N,M-1,K-1,P,dp);
        } else {
            dp[M][K] = process(N,M-1,K-1,P,dp) + process(N,M+1,K-1,P,dp);
        }
        return dp[M][K];
    }
    int getPathNum3(int N,int M,int K,int P) {
        int dp[size][size];
        for(int i=1; i<=N; i++) {
            dp[0][i] = i == P ? 1 : 0;
        }
        for(int i=1; i<=K; i++) {
            for(int j=1; j<=N; j++) {
                if(j == 1) {
                    dp[i][j] = dp[i-1][j+1];
                } else if(j == N) {
                    dp[i][j] = dp[i-1][j-1];
                } else {
                    dp[i][j] = (dp[i-1][j-1] + dp[i-1][j+1]) % (int)(1e9 + 7);
                }
            }
        }
        return dp[M][K];
    }

};

int main() {
    int N,M,K,P;
    cin >> N >> M >> K >> P;
    //调用函数即可
    return 0;
}